Initialization of new domU config options via XenAPI
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 18 Mar 2008 11:05:53 +0000 (11:05 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 18 Mar 2008 11:05:53 +0000 (11:05 +0000)
Many of the new domU config options related to hvm guests (e.g. hpet,
rtc_timeoffset, etc.) are not initialized with default values via
XenAPI, which prevents starting an hvm domU created through XenAPI.
This patch ensures the new options are set with appropriate default
values in XendConfig platform sanity check.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
tools/python/xen/xend/XendConfig.py

index fafe3e8534a269f4ce1ff7d8a4e3876524cbaab9..ec9c8c5c318557ca5f3c8a805d60c02fbcbf2c4f 100644 (file)
@@ -405,6 +405,12 @@ class XendConfig(dict):
                 self['platform']['device_model'] = xen.util.auxbin.pathTo("qemu-dm")
 
         if self.is_hvm():
+            if 'timer_mode' not in self['platform']:
+                self['platform']['timer_mode'] = 0
+            if 'rtc_timeoffset' not in self['platform']:
+                self['platform']['rtc_timeoffset'] = 0
+            if 'hpet' not in self['platform']:
+                self['platform']['hpet'] = 0
             if 'loader' not in self['platform']:
                 # Old configs may have hvmloader set as PV_kernel param
                 if self.has_key('PV_kernel') and re.search('hvmloader', self['PV_kernel']):